package com.hongyi.app.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author JoeZhou
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties("handler")
public class User implements Serializable {
    private Integer id;
    @JsonProperty("user-no-id")
    private Integer userNoId;
    @JsonProperty("role-id")
    private Integer roleId;

    @JsonProperty("user-name")
    private String username;
    private String phone;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "UTC")
    @JsonProperty("create-time")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "UTC")
    @JsonProperty("last-modify")
    private Date lastModify;
    @JsonIgnore
    private String password;
    @JsonProperty("real-name")
    private String realName;
    private Integer age;
    private Integer gender;
    private String info;

    //构造器
 public User(Integer id,String info ){
     this.id =id;
     this.info=info;
 }
    /**
     * 1:1
     */
    private UserNo userNo;

    /**
     * 1:1
     */
    private Role role;
}
